<?php
switch($action) {
case createindex;
	createindex();
	break;
case createLanMu;
	createLanMu();
	break;
case createAct;
	createAct();
	break;
}

/*生成文章*/
function createAct(){
	global $config,$userInfo;
	global $config,$userInfo;
	$Catalog = new Catalog();
	$nameClass = $Catalog->catalogTreeSort();
	if(_g('submit')){
	}else{
		include template("manage/createAct");
	}
}

/* 生成首页*/
function createIndex() {
	global $config,$userInfo;
	indexHtml();
	$filename = '更新首页';
	$msg = '更新首页成功';
	include template('manage/message');
}

/* 生成栏目页*/
function createLanMu() {
	global $config,$userInfo;
	if(_g('submit')){
		$catids = _g('catids');
		if('all' == $catids['0']){
			$Catalog = new Catalog();
			$nameClassArray = $Catalog->catalogTreeSort();
			foreach($nameClassArray as $key => $value){
				lanHtml($value);
			}
			indexHtml();
			$url = $_SERVER['HTTP_REFERER'];
			$time = '2700';
			$msg = '栏目生成完毕';
			redirect($url,$time,$msg);
		}else{
			$Catalog = new Catalog();
			foreach($catids as $k=>$v){
				$nameClass = $Catalog->getCatalog($v);
				lanHtml($nameClass);
			}
			indexHtml();
			$url = $_SERVER['HTTP_REFERER'];
			$time = '2700';
			$msg = '栏目生成完毕';
			redirect($url,$time,$msg);
		}
	}else{
		$Catalog = new Catalog();
		$nameClass = $Catalog->catalogTreeSort();
		include template('manage/createLanMu');
	}
}



?>